package com.sayimo.maker.user.dao.impl;

import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sayimo.framework.database.mybatis.AbstractMybatisBaseDao;
import com.sayimo.framework.exception.DaoException;
import com.sayimo.maker.user.dao.WalletInterfaceDao;
import com.sayimo.maker.user.vo.Wallet;

/**  
 * @Title: WalletInterfaceImplDao.java
 * @Package com.sayimo.maker.user.dao.impl
 * @Description: 
 * @author 田超
 * @date 2017年2月10日 下午5:05:54
 * @version V1.0  
 */
@Repository("walletInterfaceDao")
public class WalletInterfaceImplDao extends AbstractMybatisBaseDao<Wallet> implements WalletInterfaceDao{
	
	/**
	 * 
	* @Title: updateWallet
	* @Author: 田超
	* @Date:日期：2017年2月8日 : 下午4:00:08
	* @Description:更新钱包
	* @return Integer
	* @Version 1.0.0
	 */
	public Integer updateWallet(Wallet wallet) throws DaoException{
		return this.mybatisInterfaceBaseDao.update("com.sayimo.maker.user.dao.WalletInterfaceDao.updateWallet",wallet);
	}	
	public int insertWallet(Wallet wallet) throws DaoException {
		return this.mybatisInterfaceBaseDao.insert("com.sayimo.maker.user.dao.WalletInterfaceDao.insertWallet", wallet);
	}

	/*public int updateWallet(Wallet wallet) throws DaoException {
		return this.mybatisInterfaceBaseDao.insert("com.sayimo.maker.user.dao.WalletInterfaceDao.updateWallet", wallet);
	}*/

	public Wallet queryWalletByCustomerId(int customerId) throws DaoException {
		return this.mybatisInterfaceBaseDao.get("com.sayimo.maker.user.dao.WalletInterfaceDao.queryWalletByCustomerId", customerId);
	}

	public Map<String, Object> queryWalletInfo(int customerId) throws DaoException {
		return this.mybatisInterfaceBaseDao.queryMap("com.sayimo.maker.user.dao.WalletInterfaceDao.queryWalletInfo", "customerId", customerId);
	}
}
